<!DOCTYPE html>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <style type="text/css">
	  @import url(/resources/css/style.css);
	</style>
    <title><fmt:message key="application.welcome"/></title>
  </head>
  <body>
	<div class="bloc">
	  	<div class="main-top">
	  	</div>
	  	<div class="main-bloc">
	  		<a href="/logout"><fmt:message key="user.logout"></fmt:message></a>
	  		<a href="/home">Back</a>
	  		<br/>
	  		<form:form method="post" commandName="eventForm" action="${eventForm.action}">
	  			Step ${eventForm.step}...<br/>
	  			<form:hidden path="step"/>
	  			<c:if test="${eventForm.step==1}">
	  				<form:label path="name"><fmt:message key="event.name"/></form:label>
			        <form:input path="name" />
			        <form:label path="description"><fmt:message key="event.description"/></form:label>
			        <form:textarea path="description"/>
			        <form:select path="eventVisibility">
	  					<form:option value="1"><fmt:message key="event.public"/></form:option>
	  					<form:option value="0"><fmt:message key="event.private"/></form:option>
	  				</form:select>
			        <form:input path="userGuests[0]" class="guest" value=""/>
	  			</c:if>
	  			<c:if test="${eventForm.step>=2}">
	  				<form:hidden path="name"/>
	  				<form:hidden path="description"/>
	  				<c:set var="compteur" value="${0}"></c:set>
	  				<c:forEach var="guest" items="${eventForm.userGuests}">
	  					<input type="hidden" name="userGuests[${compteur}]" value="${guest}"/>
	  					<c:set var="compteur" value="${compteur+1}"></c:set>
	  				</c:forEach>
	  			</c:if>
	  			<c:if test="${eventForm.step==2}">
	  				<div id="event-positions">
	  				
	  				</div>
	  				<form:hidden path="eventLong[0]" class="eventLong"/>
	  				<form:hidden path="eventLat[0]" class="eventLat"/>
	  				<form:hidden path="eventTown[0]" class="eventTown"/>
	  				<form:input path="eventName[0]" class="eventName"/>
	  				
	  				
	  				
	  				<form:textarea path="eventDescription[0]" class="eventDescription"/>
	  				
	  				<div id="the-event-map" style="height:250px;width:100%px"></div>
	  				<button type="button" id="new-position"><fmt:message key="event.position.new"/></button>
	  			</c:if>
		        <input type="submit" value="create"/>
		    </form:form>
		  	<br/>
		</div>
		
		<div class="main-bottom"></div>
	</div>
	<script type="text/javascript" src="/resources/js/jquery-1.6.2.js"></script>
    <script type="text/javascript" src="/resources/js/functions.js"></script>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> 
    <script type="text/javascript" src="/resources/js/event-creation.js"></script>
  </body>
</html>
